"""
file:mytoolkit.py

author:nxm

describe:

time:2017-8-2
"""
# -*- coding: utf-8 -*-

from PyQt4 import QtCore, QtGui
import gui.mytoolkit_ui,icon.icon_rc,gui.spiderwin_ctl,gui.xueqcrawl_ctl

class MyToolkitWindow_UI(QtGui.QMainWindow, gui.mytoolkit_ui.Ui_MyToolkitWindow):
    def __init__(self):
        super(QtGui.QMainWindow, self).__init__()  # 调用父类的init函数
        super(gui.mytoolkit_ui.Ui_MyToolkitWindow, self).__init__()  # 调用父类的init函数
        self.setupUi(self)  # 初始化MotorClassUi设置
        self.setFixedSize(450,700)#设定窗口固定的长宽大小

        self.mainviewlabel.setPixmap(QtGui.QPixmap(":/main/main2.jpg"))
        self.mainviewlabel.setScaledContents(True)

        self.mainviewlabel2.setPixmap(QtGui.QPixmap(":/main/main1.jpg"))
        self.mainviewlabel2.setScaledContents(True)

        self.spiderWin = gui.spiderwin_ctl.SpiderWindow_UI()
        self.xueqcrawlWin = gui.xueqcrawl_ctl.XueqCrawlWindow_UI()

        #self.spiderButton.connect(self.spiderButton,  QtCore.SIGNAL("clicked()"), self.SpiderButtonProcess)
        self.spiderButton.clicked.connect(self.SpiderButtonProcess)
        self.xueqcrawlButton.clicked.connect(self.XueqCrawlButtonProcess)

    def SpiderButtonProcess(self):
        self.spiderWin.show()

    def XueqCrawlButtonProcess(self):
        self.xueqcrawlWin.show()

    def closeEvent(self, event):
        self.spiderWin.close()
        self.xueqcrawlWin.close()